﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Default.Master" AutoEventWireup="true"
  CodeBehind="PurchaseReport.aspx.cs" Inherits="SaleManagement.Web.Pages.PurchaseReport" %>

<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dxpc" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1.Export, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <table width="100%" class="">
    <tr>
      <td colspan="9" class="search_header">
        Báo cáo bán hàng
      </td>
    </tr>
    <tr>
      <td style="height: 19px; width: 130px">
        <asp:Literal ID="Literal5" runat="server" Text="Từ ngày"></asp:Literal>
        :
      </td>
      <td style="height: 19px; width: 130px">
        <dxe:ASPxDateEdit ID="deFromDate" ClientInstanceName="deFromDate" runat="server"
          CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" ImageFolder="~/App_Themes/Aqua/{0}/"
          ShowShadow="False" Width="100px">
          <ValidationSettings>
            <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" Width="14px" />
            <ErrorFrameStyle ImageSpacing="4px">
              <ErrorTextPaddings PaddingLeft="4px" />
            </ErrorFrameStyle>
          </ValidationSettings>
          <DropDownButton>
            <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png"
              UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png"
              Width="9px" />
          </DropDownButton>
          <CalendarProperties>
            <HeaderStyle Spacing="1px" />
            <FooterStyle Spacing="17px" />
          </CalendarProperties>
        </dxe:ASPxDateEdit>
      </td>
      <td style="height: 19px; width: 130px">
        <asp:Literal ID="Literal6" runat="server" Text="Đến ngày"></asp:Literal>
        :
      </td>
      <td style="height: 19px; width: 130px">
        <dxe:ASPxDateEdit ID="deToDate" ClientInstanceName="deToDate" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
          CssPostfix="Aqua" ImageFolder="~/App_Themes/Aqua/{0}/" ShowShadow="False" Width="100px">
          <ValidationSettings>
            <ErrorImage Height="14px" Url="~/App_Themes/Aqua/Editors/edtError.png" Width="14px" />
            <ErrorFrameStyle ImageSpacing="4px">
              <ErrorTextPaddings PaddingLeft="4px" />
            </ErrorFrameStyle>
          </ValidationSettings>
          <DropDownButton>
            <Image Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png" UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png"
              UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" UrlPressed="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png"
              Width="9px" />
          </DropDownButton>
          <CalendarProperties>
            <HeaderStyle Spacing="1px" />
            <FooterStyle Spacing="17px" />
          </CalendarProperties>
        </dxe:ASPxDateEdit>
      </td>
      <td style="width: 180px;">
        <dxe:ASPxButton ID="ASPxButton1" runat="server" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
          CssPostfix="Aqua" Text="Lọc dữ liệu" ClientInstanceName="btnSearch">
          <Image Url="../Images/find.png" />
          <ClientSideEvents Click="function(s,e){onbtnSearch(s,e);e.processOnServer=false;}" />
        </dxe:ASPxButton>
      </td>
      <td style="width: 30%;">
      </td>
    </tr>
  </table>
  <div>
    <div>
      <dxwgv:ASPxGridViewExporter ID="gvPurchaseExport" GridViewID="gvPurchase" runat="server">
      </dxwgv:ASPxGridViewExporter>
      <dxwgv:ASPxGridView ID="gvPurchase" runat="server" Width="100%" AutoGenerateColumns="False"
        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" ClientInstanceName="gvPurchase"
        OnCustomCallback="gvPurchase_CustomCallback">
        <SettingsBehavior AllowDragDrop="false" AllowSort="false" AllowGroup="True" />
        <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
        </Styles>
        <Columns>
         <dxwgv:GridViewDataTextColumn UnboundType="String" Width="30%" Caption="Mô tả" FieldName="Description"
            VisibleIndex="2">
            <HeaderStyle HorizontalAlign="Center" />
            <CellStyle HorizontalAlign="Left">
            </CellStyle>
          </dxwgv:GridViewDataTextColumn>
          <dxwgv:GridViewDataTextColumn UnboundType="String" Width="20%" Caption="Mã hóa đơn" FieldName="RefNo"
            VisibleIndex="2">
            <HeaderStyle HorizontalAlign="Center" />
            <CellStyle HorizontalAlign="Center">
            </CellStyle>
          </dxwgv:GridViewDataTextColumn>
          <dxwgv:GridViewDataDateColumn Name="Date" Caption="Ngày" Width="20%" FieldName="Date" VisibleIndex="3">
            <HeaderStyle HorizontalAlign="Center" />
            <CellStyle HorizontalAlign="Center">
            </CellStyle>
          </dxwgv:GridViewDataDateColumn>
          <dxwgv:GridViewDataTextColumn Caption="Tiền nhập" Width="15%" FieldName="InputAmount" VisibleIndex="3">
            <PropertiesTextEdit DisplayFormatString="#,###,##0">
            </PropertiesTextEdit>
            <HeaderStyle HorizontalAlign="Center" />
            <CellStyle HorizontalAlign="Right">
            </CellStyle>
          </dxwgv:GridViewDataTextColumn>
          <dxwgv:GridViewDataTextColumn Caption="Tiền xuất" Width="15%" FieldName="OutputAmount" VisibleIndex="3">
            <PropertiesTextEdit DisplayFormatString="#,###,##0">
            </PropertiesTextEdit>
            <HeaderStyle HorizontalAlign="Center" />
            <CellStyle HorizontalAlign="Right" ForeColor="Red">
            </CellStyle>
          </dxwgv:GridViewDataTextColumn>
           <dxwgv:GridViewDataTextColumn  FieldName="Total" Visible="false" VisibleIndex="3">
          </dxwgv:GridViewDataTextColumn>
        </Columns>
        <TotalSummary>         
          <dxwgv:ASPxSummaryItem FieldName="InputAmount" SummaryType="Sum" DisplayFormat="#,###,##0" />
          <dxwgv:ASPxSummaryItem FieldName="OutputAmount" SummaryType="Sum" DisplayFormat="#,###,##0" />
          <dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Count" ShowInColumn="InputAmount" DisplayFormat="Tổng:" />
          <dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Sum" ShowInColumn="OutputAmount" DisplayFormat="{0: #,###,##0}" />
        </TotalSummary>
        <Images ImageFolder="~/App_Themes/Aqua/{0}/">
          <CollapsedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" />
          <ExpandedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" />
          <DetailCollapsedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" />
          <DetailExpandedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" />
          <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" Width="19px" />
          <HeaderActiveFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png"
            Width="19px" />
          <HeaderSortDown Height="5px" Width="6px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" />
          <HeaderSortUp Height="5px" Width="6px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" />
          <FilterRowButton Height="13px" Width="13px" />
          <CustomizationWindowClose Width="18px" />
          <PopupEditFormWindowClose Width="18px" />
          <WindowResizer Height="13px" Width="12px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" />
          <FilterBuilderClose Width="18px" />
        </Images>
        <StylesEditors>
          <ProgressBar Height="25px">
          </ProgressBar>
        </StylesEditors>
        <ImagesEditors>
          <CalendarPrevYear Width="23px" />
          <CalendarPrevMonth Width="19px" />
          <CalendarNextMonth Width="19px" />
          <CalendarNextYear Width="23px" />
          <CalendarFastNavPrevYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" />
          <CalendarFastNavNextYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" />
          <DropDownEditDropDown Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png"
            UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" />
          <SpinEditIncrement Height="6px" Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png"
            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png"
            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" />
          <SpinEditDecrement Height="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png"
            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png"
            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" />
          <SpinEditLargeIncrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png"
            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png"
            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" />
          <SpinEditLargeDecrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png"
            UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png"
            UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" />
        </ImagesEditors>
        <SettingsLoadingPanel Text="" />
        <SettingsPager PageSize="25">
          <AllButton>
            <Image Height="19px" Width="28px" />
          </AllButton>
          <FirstPageButton>
            <Image Height="19px" Width="23px" />
          </FirstPageButton>
          <LastPageButton>
            <Image Height="19px" Width="23px" />
          </LastPageButton>
          <NextPageButton>
            <Image Height="19px" Width="19px" />
          </NextPageButton>
          <PrevPageButton>
            <Image Height="19px" Width="19px" />
          </PrevPageButton>
        </SettingsPager>
        <Settings ShowFooter="True" />
      </dxwgv:ASPxGridView>
    </div>
    <div style="padding-left: 300px; padding-top: 10px; padding-bottom: 20px;">
      <div style="float: left">
        <dxe:ASPxButton AutoPostBack="False" ID="btnExport" runat="server" Text="Xuất file excel"
          EnableViewState="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
          OnClick="btnExport_Click">
        </dxe:ASPxButton>
      </div>
      <div style="float: left">
        <dxe:ASPxButton AutoPostBack="False" ID="btnPdfExport" runat="server" Visible="false"
          Text="Xuất file pdf" EnableViewState="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css"
          CssPostfix="Aqua" OnClick="btnPdfExport_Click">
        </dxe:ASPxButton>
      </div>
    </div>
  </div>
  <div style="display: none">
    <dxwgv:ASPxGridView ID="gvExport" runat="server" Width="100%" AutoGenerateColumns="False"
      CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" KeyFieldName="ProductId"
      ClientInstanceName="gvExport">
      <SettingsBehavior AllowDragDrop="false" AllowSort="false" AllowGroup="True" />
      <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
      </Styles>
      <Columns>
        <dxwgv:GridViewDataTextColumn FieldName="ProductId" Visible="false">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="ProductName" VisibleIndex="0" Caption="Sản phẩm">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="CurrentQuantity" VisibleIndex="0" Caption="Số lượng tồn kho">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="RepositoryName" VisibleIndex="1" Caption="Kho">
          <HeaderStyle HorizontalAlign="Center" />
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="ResQuantity" VisibleIndex="1" Caption="Số lượng">
          <HeaderStyle HorizontalAlign="Center" />
        </dxwgv:GridViewDataTextColumn>
      </Columns>
      <Images ImageFolder="~/App_Themes/Aqua/{0}/">
        <CollapsedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" />
        <ExpandedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" />
        <DetailCollapsedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" />
        <DetailExpandedButton Height="15px" Width="13px" Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" />
        <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" Width="19px" />
        <HeaderActiveFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png"
          Width="19px" />
        <HeaderSortDown Height="5px" Width="6px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" />
        <HeaderSortUp Height="5px" Width="6px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" />
        <FilterRowButton Height="13px" Width="13px" />
        <CustomizationWindowClose Width="18px" />
        <PopupEditFormWindowClose Width="18px" />
        <WindowResizer Height="13px" Width="12px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" />
        <FilterBuilderClose Width="18px" />
      </Images>
      <StylesEditors>
        <ProgressBar Height="25px">
        </ProgressBar>
      </StylesEditors>
      <ImagesEditors>
        <CalendarPrevYear Width="23px" />
        <CalendarPrevMonth Width="19px" />
        <CalendarNextMonth Width="19px" />
        <CalendarNextYear Width="23px" />
        <CalendarFastNavPrevYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" />
        <CalendarFastNavNextYear Height="19px" Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" />
        <DropDownEditDropDown Height="7px" Url="~/App_Themes/Aqua/Editors/edtDropDown.png"
          UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" />
        <SpinEditIncrement Height="6px" Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png"
          UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png"
          UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" />
        <SpinEditDecrement Height="7px" Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png"
          UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png"
          UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" />
        <SpinEditLargeIncrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png"
          UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png"
          UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" />
        <SpinEditLargeDecrement Height="9px" Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png"
          UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png"
          UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" />
      </ImagesEditors>
      <SettingsLoadingPanel Text="" />
      <SettingsPager PageSize="25">
        <AllButton>
          <Image Height="19px" Width="28px" />
        </AllButton>
        <FirstPageButton>
          <Image Height="19px" Width="23px" />
        </FirstPageButton>
        <LastPageButton>
          <Image Height="19px" Width="23px" />
        </LastPageButton>
        <NextPageButton>
          <Image Height="19px" Width="19px" />
        </NextPageButton>
        <PrevPageButton>
          <Image Height="19px" Width="19px" />
        </PrevPageButton>
      </SettingsPager>
    </dxwgv:ASPxGridView>
  </div>

  <script type="text/javascript">
    function onbtnSearch(s, e) {
      gvPurchase.PerformCallback();
    }

  </script>

</asp:Content>
